$(function () {
    let nav = $('.div_one');
    let li = $('#nav_ul>li');

    li.has('.div_one').on({
        mouseover() {
            nav.addClass('div_height')
            $(this).children()[1].style.display = 'block'
            nav.not($(this).children()[1]).css('display', 'none')
        },
        mouseout() {
            nav.removeClass('div_height')
        }
    })

    if (cookie.get('account') !== null) {
        let user = $('.header-right');
        user.html(`
            <a href="#">${cookie.get('account')}</a>
            <span class="sep">|</span>
            <a href="#" class="exit">退出</a>
            <span class="sep">|</span>
            <a href="#">消息通知</a>
            <a class="shopp"  href="./cart.html">
                <div class="shopp-tit"><i class="iconfont icon-gouwuchekong"></i>购物车(0)</div>
                <div class="trolley">
                    购物车中还没有商品,赶紧选购吧
                </div>
            </a>
           `)
        let exit = $('.header-right>.exit')
        exit.on('click', function () {
            cookie.remove('account')
            history.go(0)
        })
    }
})